<!DOCTYPE HTML>
<html>
	<head>
		<meta http-equiv="Content-Type" content="html/html; charset=utf-8" />
		<title>GRMustacheContext Class Reference</title>
		<meta id="xcode-display" name="xcode-display" content="render"/>
		<link rel="stylesheet" type="text/css" href="../css/styles.css" media="all" />
		<link rel="stylesheet" type="text/css" media="print" href="../css/stylesPrint.css" />
		<meta name="generator" content="appledoc 2.2 (build 961)" />
	</head>
	<body>
		<header id="top_header">
			<div id="library" class="hideInXcode">
				<h1><a id="libraryTitle" href="../index.html">GRMustache 7.3 </a></h1>
				<a id="developerHome" href="../index.html">Gwendal Roué</a>
			</div>
			
			<div id="title" role="banner">
				<h1 class="hideInXcode">GRMustacheContext Class Reference</h1>
			</div>
			<ul id="headerButtons" role="toolbar">
				<li id="toc_button">
					<button aria-label="Show Table of Contents" role="checkbox" class="open" id="table_of_contents"><span class="disclosure"></span>Table of Contents</button>
				</li>
				<li id="jumpto_button" role="navigation">
					<select id="jumpTo">
	<option value="top">Jump To&#133;</option>
	
	<option value="overview">Overview</option>
	
	
	
	
	<option value="tasks">Tasks</option>
	
	
	
	
	
	<option value="properties">Properties</option>
	
	<option value="//api/name/topMustacheObject">&nbsp;&nbsp;&nbsp;&nbsp;topMustacheObject</option>
	
	<option value="//api/name/unsafeKeyAccess">&nbsp;&nbsp;&nbsp;&nbsp;unsafeKeyAccess</option>
	
	
	
	
	<option value="class_methods">Class Methods</option>
	
	<option value="//api/name/context">&nbsp;&nbsp;&nbsp;&nbsp;+ context</option>
	
	<option value="//api/name/contextWithObject:">&nbsp;&nbsp;&nbsp;&nbsp;+ contextWithObject:</option>
	
	<option value="//api/name/contextWithProtectedObject:">&nbsp;&nbsp;&nbsp;&nbsp;+ contextWithProtectedObject:</option>
	
	<option value="//api/name/contextWithTagDelegate:">&nbsp;&nbsp;&nbsp;&nbsp;+ contextWithTagDelegate:</option>
	
	<option value="//api/name/contextWithUnsafeKeyAccess">&nbsp;&nbsp;&nbsp;&nbsp;+ contextWithUnsafeKeyAccess</option>
	
	
	
	
	<option value="instance_methods">Instance Methods</option>
	
	<option value="//api/name/contextByAddingObject:">&nbsp;&nbsp;&nbsp;&nbsp;- contextByAddingObject:</option>
	
	<option value="//api/name/contextByAddingProtectedObject:">&nbsp;&nbsp;&nbsp;&nbsp;- contextByAddingProtectedObject:</option>
	
	<option value="//api/name/contextByAddingTagDelegate:">&nbsp;&nbsp;&nbsp;&nbsp;- contextByAddingTagDelegate:</option>
	
	<option value="//api/name/contextWithUnsafeKeyAccess">&nbsp;&nbsp;&nbsp;&nbsp;- contextWithUnsafeKeyAccess</option>
	
	<option value="//api/name/hasValue:forMustacheExpression:error:">&nbsp;&nbsp;&nbsp;&nbsp;- hasValue:forMustacheExpression:error:</option>
	
	<option value="//api/name/init">&nbsp;&nbsp;&nbsp;&nbsp;- init</option>
	
	<option value="//api/name/valueForMustacheKey:">&nbsp;&nbsp;&nbsp;&nbsp;- valueForMustacheKey:</option>
	
	
	
</select>
				</li>
			</ul>
		</header>
		<nav id="tocContainer" class="isShowingTOC">
			<ul id="toc" role="tree">
				
<li role="treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#overview">Overview</a></span></li>




<li role="treeitem" id="task_treeitem"><span class="nodisclosure"></span><span class="sectionName"><a href="#tasks">Tasks</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Creating Rendering Contexts">Creating Rendering Contexts</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Deriving New Contexts">Deriving New Contexts</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Fetching Values from the Context Stack">Fetching Values from the Context Stack</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#task_Unsafe Key Access">Unsafe Key Access</a></span></li>
	
</ul></li>





<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#properties">Properties</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/topMustacheObject">topMustacheObject</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/unsafeKeyAccess">unsafeKeyAccess</a></span></li>
	
</ul></li>



<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#class_methods">Class Methods</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/context">context</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/contextWithObject:">contextWithObject:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/contextWithProtectedObject:">contextWithProtectedObject:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/contextWithTagDelegate:">contextWithTagDelegate:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/contextWithUnsafeKeyAccess">contextWithUnsafeKeyAccess</a></span></li>
	
</ul></li>



<li role="treeitem" class="children"><span class="disclosure"></span><span class="sectionName"><a href="#instance_methods">Instance Methods</a></span><ul>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/contextByAddingObject:">contextByAddingObject:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/contextByAddingProtectedObject:">contextByAddingProtectedObject:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/contextByAddingTagDelegate:">contextByAddingTagDelegate:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/contextWithUnsafeKeyAccess">contextWithUnsafeKeyAccess</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/hasValue:forMustacheExpression:error:">hasValue:forMustacheExpression:error:</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/init">init</a></span></li>
	
	<li><span class="nodisclosure"></span><span class="sectionName"><a href="#//api/name/valueForMustacheKey:">valueForMustacheKey:</a></span></li>
	
</ul></li>


			</ul>
		</nav>
		<article>
			<div id="contents" class="isShowingTOC" role="main">
				<a title="GRMustacheContext Class Reference" name="top"></a>
				<div class="main-navigation navigation-top">
					<ul>
	<li><a href="../index.html">Index</a></li>
	<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
				</div>
				<div id="header">
					<div class="section-header">
						<h1 class="title title-header">GRMustacheContext Class Reference</h1>
					</div>		
				</div>
				<div id="container">	
					
					<div class="section section-specification"><table cellspacing="0"><tbody>
						<tr>
	<td class="specification-title">Inherits from</td>
	<td class="specification-value">NSObject</td>
</tr><tr>
	<td class="specification-title">Declared in</td>
	<td class="specification-value">GRMustacheContext.h</td>
</tr>
						</tbody></table></div>
					
                    
                    
					
					<div class="section section-overview">
						<a title="Overview" name="overview"></a>
						<h2 class="subtitle subtitle-overview">Overview</h2>
						<p>The GRMustacheContext represents a Mustache rendering context: it internally
maintains three stacks:</p>

<ul>
<li><p>a <em><a href="#//api/name/context">context</a> stack</em>, that makes it able to provide the current <a href="#//api/name/context">context</a>
object, and to perform key lookup.</p></li>
<li><p>a <em>priority <a href="#//api/name/context">context</a> stack</em>, whose objects define important keys that
should not be overriden.</p></li>
<li><p>a <em>tag delegate stack</em>, so that tag delegates are notified when a Mustache
tag is rendered.</p></li>
</ul>


<p><strong>Companion guides:</strong></p>

<ul>
<li><a href="https://github.com/groue/GRMustache/blob/master/Guides/view">https://github.com/groue/GRMustache/blob/master/Guides/view</a>_model.md</li>
<li><a href="https://github.com/groue/GRMustache/blob/master/Guides/delegate.md">https://github.com/groue/GRMustache/blob/master/Guides/delegate.md</a></li>
<li><a href="https://github.com/groue/GRMustache/blob/master/Guides/rendering">https://github.com/groue/GRMustache/blob/master/Guides/rendering</a>_objects.md</li>
<li><a href="https://github.com/groue/GRMustache/blob/master/Guides/security.md">https://github.com/groue/GRMustache/blob/master/Guides/security.md</a></li>
</ul>
<div class="warning"><p><strong>Warning:</strong> GRMustacheContext is not suitable for subclassing.</p></div>
					</div>
					
					
					
					
					
					<div class="section section-tasks">
						<a title="Tasks" name="tasks"></a>
						<h2 class="subtitle subtitle-tasks">Tasks</h2>
						
						
						<a title="Creating Rendering Contexts" name="task_Creating Rendering Contexts"></a>
						<h3 class="subsubtitle task-title">Creating Rendering Contexts</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/init">&ndash;&nbsp;init</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/context">+&nbsp;context</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/contextWithObject:">+&nbsp;contextWithObject:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/contextWithProtectedObject:">+&nbsp;contextWithProtectedObject:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/contextWithTagDelegate:">+&nbsp;contextWithTagDelegate:</a></code>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="Deriving New Contexts" name="task_Deriving New Contexts"></a>
						<h3 class="subsubtitle task-title">Deriving New Contexts</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/contextByAddingObject:">&ndash;&nbsp;contextByAddingObject:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/contextByAddingProtectedObject:">&ndash;&nbsp;contextByAddingProtectedObject:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/contextByAddingTagDelegate:">&ndash;&nbsp;contextByAddingTagDelegate:</a></code>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="Fetching Values from the Context Stack" name="task_Fetching Values from the Context Stack"></a>
						<h3 class="subsubtitle task-title">Fetching Values from the Context Stack</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/topMustacheObject">&nbsp;&nbsp;topMustacheObject</a></code>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/valueForMustacheKey:">&ndash;&nbsp;valueForMustacheKey:</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/hasValue:forMustacheExpression:error:">&ndash;&nbsp;hasValue:forMustacheExpression:error:</a></code>
	</span>
	
	
</li>
						</ul>
						
						
						<a title="Unsafe Key Access" name="task_Unsafe Key Access"></a>
						<h3 class="subsubtitle task-title">Unsafe Key Access</h3>

						<ul class="task-list">
							<li>
	<span class="tooltip">
		<code><a href="#//api/name/unsafeKeyAccess">&nbsp;&nbsp;unsafeKeyAccess</a></code>
	</span>
	<span class="task-item-suffix">property</span>
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/contextWithUnsafeKeyAccess">+&nbsp;contextWithUnsafeKeyAccess</a></code>
	</span>
	
	
</li><li>
	<span class="tooltip">
		<code><a href="#//api/name/contextWithUnsafeKeyAccess">&ndash;&nbsp;contextWithUnsafeKeyAccess</a></code>
	</span>
	
	
</li>
						</ul>
						
					</div>
					
					
					
					
					
					<div class="section section-methods">
						<a title="Properties" name="properties"></a>
						<h2 class="subtitle subtitle-methods">Properties</h2>
						
						<div class="section-method">
	<a name="//api/name/topMustacheObject" title="topMustacheObject"></a>
	<h3 class="subsubtitle method-title">topMustacheObject</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Returns the object at the top of the receiver&rsquo;s <a href="#//api/name/context">context</a> stack.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (nonatomic, readonly) id topMustacheObject</code></div>

    
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>The object at the top of the receiver&rsquo;s <a href="#//api/name/context">context</a> stack.</p>
	</div>
	
	
	
	<div class="method-subsection availability">
		<h4 class="method-subtitle parameter-title">Availability</h4>
		<p>v6.7</p>
	</div>
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>The returned object is the same as the one that would be rendered by a
<code>{{ . }}</code> tag.</p>

<pre><code>user = ...;
context = [GRMustacheContext contextWithObject:user];
context.topMustacheObject;  // user
</code></pre>
	</div>
	
	
	
	
	
	<div class="method-subsection see-also-section">
		<h4 class="method-subtitle">See Also</h4>
		<ul>
			
			<li><code><p><a href="#//api/name/contextWithObject:">+ contextWithObject:</a></p></code></li>
			
			<li><code><p><a href="#//api/name/contextByAddingObject:">- contextByAddingObject:</a></p></code></li>
			
		</ul>
	</div>
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">GRMustacheContext.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/unsafeKeyAccess" title="unsafeKeyAccess"></a>
	<h3 class="subsubtitle method-title">unsafeKeyAccess</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Returns whether this <a href="#//api/name/context">context</a> allows unsafe key access or not.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>@property (nonatomic, readonly) BOOL unsafeKeyAccess</code></div>

    
	
	
	
	
	
	<div class="method-subsection availability">
		<h4 class="method-subtitle parameter-title">Availability</h4>
		<p>v7.0</p>
	</div>
	
	
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">GRMustacheContext.h</code><br />
	</div>				
	
	
</div>
						
					</div>
					
					
					
					<div class="section section-methods">
						<a title="Class Methods" name="class_methods"></a>
						<h2 class="subtitle subtitle-methods">Class Methods</h2>
						
						<div class="section-method">
	<a name="//api/name/context" title="context"></a>
	<h3 class="subsubtitle method-title">context</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Returns an empty rendering context.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>+ (instancetype)context</code></div>

    
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>A rendering context.</p>
	</div>
	
	
	
	<div class="method-subsection availability">
		<h4 class="method-subtitle parameter-title">Availability</h4>
		<p>v6.4</p>
	</div>
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>Empty contexts do not provide any value for any key.</p>

<p>If you wish to use the services provided by the GRMustache standard library,
you should create a context with the <a href="#//api/name/contextWithObject:">[GRMustacheContext contextWithObject:]</a>
method, like this:</p>

<pre><code>[GRMustacheContext contextWithObject:[GRMustache standardLibrary]]
</code></pre>
	</div>
	
	
	
	
	
	<div class="method-subsection see-also-section">
		<h4 class="method-subtitle">See Also</h4>
		<ul>
			
			<li><code><p><a href="#//api/name/contextWithObject:">+ contextWithObject:</a></p></code></li>
			
			<li><code><p><a href="../Classes/GRMustache.html#//api/name/standardLibrary">[GRMustache standardLibrary]</a></p></code></li>
			
		</ul>
	</div>
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">GRMustacheContext.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/contextWithObject:" title="contextWithObject:"></a>
	<h3 class="subsubtitle method-title">contextWithObject:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Returns a rendering <a href="#//api/name/context">context</a> containing a single object.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>+ (instancetype)contextWithObject:(id)<em>object</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>object</em></dt>
			<dd><p>An object</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>A rendering <a href="#//api/name/context">context</a>.</p>
	</div>
	
	
	
	<div class="method-subsection availability">
		<h4 class="method-subtitle parameter-title">Availability</h4>
		<p>v6.4</p>
	</div>
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>Keys defined by <em>object</em> gets available for template rendering.</p>

<pre><code>context = [GRMustacheContext contextWithObject:@{ @"name": @"Arthur" }];
[context valueForMustacheKey:@"name"];   // @"Arthur"
</code></pre>

<p>If <em>object</em> conforms to the GRMustacheTemplateDelegate protocol, it is also
made the top of the tag delegate stack.</p>

<p><strong>Companion guide:</strong> <a href="https://github.com/groue/GRMustache/blob/master/Guides/delegate.md">https://github.com/groue/GRMustache/blob/master/Guides/delegate.md</a></p>
	</div>
	
	
	
	
	
	<div class="method-subsection see-also-section">
		<h4 class="method-subtitle">See Also</h4>
		<ul>
			
			<li><code><p><a href="#//api/name/contextByAddingObject:">- contextByAddingObject:</a></p></code></li>
			
		</ul>
	</div>
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">GRMustacheContext.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/contextWithProtectedObject:" title="contextWithProtectedObject:"></a>
	<h3 class="subsubtitle method-title">contextWithProtectedObject:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Returns a <a href="#//api/name/context">context</a> containing a single priority object.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>+ (instancetype)contextWithProtectedObject:(id)<em>object</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>object</em></dt>
			<dd><p>An object</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>A rendering <a href="#//api/name/context">context</a>.</p>
	</div>
	
	
	
	<div class="method-subsection availability">
		<h4 class="method-subtitle parameter-title">Availability</h4>
		<p>v6.4</p>
	</div>
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>Keys defined by <em>object</em> are given priority, which means that they can not be
overriden by other objects that will eventually enter the <a href="#//api/name/context">context</a> stack.</p>

<pre><code>// Create a context with a priority `precious` key
context = [GRMustacheContext contextWithProtectedObject:@{ @"precious": @"gold" }];

// Derive a new context by attempting to override the `precious` key:
context = [context contextByAddingObject:@{ @"precious": @"lead" }];

// Priority keys can't be overriden
[context valueForMustacheKey:@"precious"];   // @"gold"
</code></pre>

<p><strong>Companion guide:</strong> <a href="https://github.com/groue/GRMustache/blob/master/Guides/security.md">https://github.com/groue/GRMustache/blob/master/Guides/security.md</a>#priority-keys</p>
	</div>
	
	
	
	
	
	<div class="method-subsection see-also-section">
		<h4 class="method-subtitle">See Also</h4>
		<ul>
			
			<li><code><p><a href="#//api/name/contextByAddingProtectedObject:">- contextByAddingProtectedObject:</a></p></code></li>
			
		</ul>
	</div>
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">GRMustacheContext.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/contextWithTagDelegate:" title="contextWithTagDelegate:"></a>
	<h3 class="subsubtitle method-title">contextWithTagDelegate:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Returns a <a href="#//api/name/context">context</a> containing a single tag delegate.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>+ (instancetype)contextWithTagDelegate:(id&lt;GRMustacheTagDelegate&gt;)<em>tagDelegate</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>tagDelegate</em></dt>
			<dd><p>A tag delegate</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>A rendering <a href="#//api/name/context">context</a>.</p>
	</div>
	
	
	
	<div class="method-subsection availability">
		<h4 class="method-subtitle parameter-title">Availability</h4>
		<p>v6.4</p>
	</div>
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p><em>tagDelegate</em> will be notified of the rendering of all tags rendered from the
receiver or from contexts derived from the receiver.</p>

<p>Unlike <a href="#//api/name/contextWithObject:">contextWithObject:</a> and <a href="#//api/name/contextWithProtectedObject:">contextWithProtectedObject:</a>, <em>tagDelegate</em> will
not provide any key to the templates. It will only be notified of the
rendering of tags.</p>

<p><strong>Companion guide:</strong> <a href="https://github.com/groue/GRMustache/blob/master/Guides/delegate.md">https://github.com/groue/GRMustache/blob/master/Guides/delegate.md</a></p>
	</div>
	
	
	
	
	
	<div class="method-subsection see-also-section">
		<h4 class="method-subtitle">See Also</h4>
		<ul>
			
			<li><code><p><a href="../Protocols/GRMustacheTagDelegate.html">GRMustacheTagDelegate</a></p></code></li>
			
		</ul>
	</div>
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">GRMustacheContext.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/contextWithUnsafeKeyAccess" title="contextWithUnsafeKeyAccess"></a>
	<h3 class="subsubtitle method-title">contextWithUnsafeKeyAccess</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Returns a new <a href="#//api/name/context">context</a> with unsafe key access.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>+ (instancetype)contextWithUnsafeKeyAccess</code></div>

    
	
	
	
	
	
	<div class="method-subsection availability">
		<h4 class="method-subtitle parameter-title">Availability</h4>
		<p>v7.0</p>
	</div>
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>Unsafe key access allows this <a href="#//api/name/context">context</a>, and all contexts derived from it, to
access keys that are normally forbidden: keys that are not declared as
Objective-C properties, or keys that do not belong to the result of the
<code>safeMustacheKeys</code> method.</p>

<p>Compare:</p>

<pre><code>@interface DBRecord : NSObject
- (void)deleteRecord;
@end

@implementation DBRecord
- (void)deleteRecord
{
    NSLog(@"Oooops, your record was just deleted!");
}
@end

DBRecord *record = ...;
NSString *templateString = @"{{ deleteRecord }}";
GRMustacheTemplate * template = [GRMustacheTemplate templateWithString:templateString error:NULL];

// Safe rendering of the dangerous template: record is not deleted.
[template renderObject:record error:NULL];

// Unsafe rendering of the dangerous template: record is deleted.
template.baseContext = [GRMustacheContext contextWithUnsafeKeyAccess];
[template renderObject:record error:NULL];
</code></pre>

<p><strong>Companion guide:</strong> <a href="https://github.com/groue/GRMustache/blob/master/Guides/security.md">https://github.com/groue/GRMustache/blob/master/Guides/security.md</a></p>
	</div>
	
	
	
	
	
	<div class="method-subsection see-also-section">
		<h4 class="method-subtitle">See Also</h4>
		<ul>
			
			<li><code><p><a href="../Protocols/GRMustacheSafeKeyAccess.html">GRMustacheSafeKeyAccess</a></p></code></li>
			
		</ul>
	</div>
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">GRMustacheContext.h</code><br />
	</div>				
	
	
</div>
						
					</div>
					
					
					
					<div class="section section-methods">
						<a title="Instance Methods" name="instance_methods"></a>
						<h2 class="subtitle subtitle-methods">Instance Methods</h2>
						
						<div class="section-method">
	<a name="//api/name/contextByAddingObject:" title="contextByAddingObject:"></a>
	<h3 class="subsubtitle method-title">contextByAddingObject:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Returns a new rendering <a href="#//api/name/context">context</a> that is the copy of the receiver, and the
given object added at the top of the <a href="#//api/name/context">context</a> stack.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (instancetype)contextByAddingObject:(id)<em>object</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>object</em></dt>
			<dd><p>An object</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>A new rendering <a href="#//api/name/context">context</a>.</p>
	</div>
	
	
	
	<div class="method-subsection availability">
		<h4 class="method-subtitle parameter-title">Availability</h4>
		<p>v6.0</p>
	</div>
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>Keys defined by <em>object</em> gets available for template rendering, and override
the values defined by objects already contained in the <a href="#//api/name/context">context</a> stack. Keys
unknown to <em>object</em> will be looked up deeper in the <a href="#//api/name/context">context</a> stack.</p>

<pre><code>context = [GRMustacheContext contextWithObject:@{ @"a": @"ignored", @"b": @"foo" }];
context = [context contextByAddingObject:@{ @"a": @"bar" }];

// `a` is overriden
[context valueForMustacheKey:@"a"];   // @"bar"

// `b` is inherited
[context valueForMustacheKey:@"b"];   // @"foo"
</code></pre>

<p><em>object</em> can not override keys defined by the objects of the priority
<a href="#//api/name/context">context</a> stack, though. See <a href="#//api/name/contextWithProtectedObject:">contextWithProtectedObject:</a> and
<a href="#//api/name/contextByAddingProtectedObject:">contextByAddingProtectedObject:</a>.</p>

<p>If <em>object</em> conforms to the GRMustacheTemplateDelegate protocol, it is also
added at the top of the tag delegate stack.</p>

<p><strong>Companion guide:</strong> <a href="https://github.com/groue/GRMustache/blob/master/Guides/delegate.md">https://github.com/groue/GRMustache/blob/master/Guides/delegate.md</a></p>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">GRMustacheContext.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/contextByAddingProtectedObject:" title="contextByAddingProtectedObject:"></a>
	<h3 class="subsubtitle method-title">contextByAddingProtectedObject:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Returns a new rendering <a href="#//api/name/context">context</a> that is the copy of the receiver, and the
given object added at the top of the priority <a href="#//api/name/context">context</a> stack.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (instancetype)contextByAddingProtectedObject:(id)<em>object</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>object</em></dt>
			<dd><p>An object</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>A new rendering <a href="#//api/name/context">context</a>.</p>
	</div>
	
	
	
	<div class="method-subsection availability">
		<h4 class="method-subtitle parameter-title">Availability</h4>
		<p>v6.0</p>
	</div>
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>Keys defined by <em>object</em> are given priority, which means that they can not be
overriden by other objects that will eventually enter the <a href="#//api/name/context">context</a> stack.</p>

<pre><code>// Derive a context with a priority `precious` key
context = [context contextByAddingProtectedObject:@{ @"precious": @"gold" }];

// Derive a new context by attempting to override the `precious` key:
context = [context contextByAddingObject:@{ @"precious": @"lead" }];

// Priority keys can't be overriden
[context valueForMustacheKey:@"precious"];   // @"gold"
</code></pre>

<p><strong>Companion guide:</strong> <a href="https://github.com/groue/GRMustache/blob/master/Guides/security.md">https://github.com/groue/GRMustache/blob/master/Guides/security.md</a>#priority-keys</p>
	</div>
	
	
	
	
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">GRMustacheContext.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/contextByAddingTagDelegate:" title="contextByAddingTagDelegate:"></a>
	<h3 class="subsubtitle method-title">contextByAddingTagDelegate:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Returns a new rendering <a href="#//api/name/context">context</a> that is the copy of the receiver, and the
given object added at the top of the tag delegate stack.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (instancetype)contextByAddingTagDelegate:(id&lt;GRMustacheTagDelegate&gt;)<em>tagDelegate</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>tagDelegate</em></dt>
			<dd><p>A tag delegate</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>A new rendering <a href="#//api/name/context">context</a>.</p>
	</div>
	
	
	
	<div class="method-subsection availability">
		<h4 class="method-subtitle parameter-title">Availability</h4>
		<p>v6.0</p>
	</div>
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p><em>tagDelegate</em> will be notified of the rendering of all tags rendered from the
receiver or from contexts derived from the receiver.</p>

<p>Unlike <a href="#//api/name/contextByAddingObject:">contextByAddingObject:</a> and <a href="#//api/name/contextByAddingProtectedObject:">contextByAddingProtectedObject:</a>,
<em>tagDelegate</em> will not provide any key to the templates. It will only be
notified of the rendering of tags.</p>

<p><strong>Companion guide:</strong> <a href="https://github.com/groue/GRMustache/blob/master/Guides/delegate.md">https://github.com/groue/GRMustache/blob/master/Guides/delegate.md</a></p>
	</div>
	
	
	
	
	
	<div class="method-subsection see-also-section">
		<h4 class="method-subtitle">See Also</h4>
		<ul>
			
			<li><code><p><a href="../Protocols/GRMustacheTagDelegate.html">GRMustacheTagDelegate</a></p></code></li>
			
		</ul>
	</div>
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">GRMustacheContext.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/contextWithUnsafeKeyAccess" title="contextWithUnsafeKeyAccess"></a>
	<h3 class="subsubtitle method-title">contextWithUnsafeKeyAccess</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Returns a new rendering <a href="#//api/name/context">context</a> that is the copy of the receiver, with unsafe
key access.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (instancetype)contextWithUnsafeKeyAccess</code></div>

    
	
	
	
	
	
	<div class="method-subsection availability">
		<h4 class="method-subtitle parameter-title">Availability</h4>
		<p>v7.0</p>
	</div>
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>Unsafe key access allows this <a href="#//api/name/context">context</a>, and all contexts derived from it, to
access keys that are normally forbidden: keys that are not declared as
Objective-C properties, or keys that do not belong to the result of the
<code>safeMustacheKeys</code> method.</p>

<p>Compare:</p>

<pre><code>@interface DBRecord : NSObject
- (void)deleteRecord;
@end

@implementation DBRecord
- (void)deleteRecord
{
    NSLog(@"Oooops, your record was just deleted!");
}
@end

DBRecord *record = ...;
NSString *templateString = @"{{ deleteRecord }}";
GRMustacheTemplate * template = [GRMustacheTemplate templateWithString:templateString error:NULL];

// Safe rendering of the dangerous template: record is not deleted.
[template renderObject:record error:NULL];

// Unsafe rendering of the dangerous template: record is deleted.
template.baseContext = [template.baseContext contextWithUnsafeKeyAccess];
[template renderObject:record error:NULL];
</code></pre>

<p><strong>Companion guide:</strong> <a href="https://github.com/groue/GRMustache/blob/master/Guides/security.md">https://github.com/groue/GRMustache/blob/master/Guides/security.md</a></p>
	</div>
	
	
	
	
	
	<div class="method-subsection see-also-section">
		<h4 class="method-subtitle">See Also</h4>
		<ul>
			
			<li><code><p><a href="../Protocols/GRMustacheSafeKeyAccess.html">GRMustacheSafeKeyAccess</a></p></code></li>
			
		</ul>
	</div>
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">GRMustacheContext.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/hasValue:forMustacheExpression:error:" title="hasValue:forMustacheExpression:error:"></a>
	<h3 class="subsubtitle method-title">hasValue:forMustacheExpression:error:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Evaluates an expression such as <code>name</code>, or <code>uppercase(user.name)</code>.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (BOOL)hasValue:(id *)<em>value</em> forMustacheExpression:(NSString *)<em>expression</em> error:(NSError **)<em>error</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>value</em></dt>
			<dd><p>Upon return contains the value of the expression.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>expression</em></dt>
			<dd><p>An expression.</p></dd>
		</dl>
		
		<dl class="argument-def parameter-def">
			<dt><em>error</em></dt>
			<dd><p>If there is an error computing the value, upon return
contains an NSError object that describes the problem.</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>YES if the value could be computed.</p>
	</div>
	
	
	
	<div class="method-subsection availability">
		<h4 class="method-subtitle parameter-title">Availability</h4>
		<p>v6.8</p>
	</div>
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p><strong>Companion guide:</strong> <a href="https://github.com/groue/GRMustache/blob/master/Guides/view_model.md">https://github.com/groue/GRMustache/blob/master/Guides/view_model.md</a></p>
	</div>
	
	
	
	
	
	<div class="method-subsection see-also-section">
		<h4 class="method-subtitle">See Also</h4>
		<ul>
			
			<li><code><p><a href="#//api/name/valueForMustacheKey:">- valueForMustacheKey:</a></p></code></li>
			
		</ul>
	</div>
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">GRMustacheContext.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/init" title="init"></a>
	<h3 class="subsubtitle method-title">init</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Returns an initialized empty rendering <a href="#//api/name/context">context</a>.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (instancetype)init</code></div>

    
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>A rendering <a href="#//api/name/context">context</a>.</p>
	</div>
	
	
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>Empty contexts do not provide any value for any key.</p>

<p>If you wish to use the services provided by the GRMustache standard library,
you should create a context with the <a href="#//api/name/contextWithObject:">[GRMustacheContext contextWithObject:]</a>
method, like this:</p>

<pre><code>[GRMustacheContext contextWithObject:[GRMustache standardLibrary]]
</code></pre>
	</div>
	
	
	
	
	
	<div class="method-subsection see-also-section">
		<h4 class="method-subtitle">See Also</h4>
		<ul>
			
			<li><code><p><a href="../Classes/GRMustache.html#//api/name/standardLibrary">[GRMustache standardLibrary]</a></p></code></li>
			
		</ul>
	</div>
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">GRMustacheContext.h</code><br />
	</div>				
	
	
</div>
						
						<div class="section-method">
	<a name="//api/name/valueForMustacheKey:" title="valueForMustacheKey:"></a>
	<h3 class="subsubtitle method-title">valueForMustacheKey:</h3>
	
	
	
	<div class="method-subsection brief-description">
		<p>Returns the value stored in the <a href="#//api/name/context">context</a> stack for the given key.</p>
	</div>		
	
    

	<div class="method-subsection method-declaration"><code>- (id)valueForMustacheKey:(NSString *)<em>key</em></code></div>

    
	
	<div class="method-subsection arguments-section parameters">
		<h4 class="method-subtitle parameter-title">Parameters</h4>
		
		<dl class="argument-def parameter-def">
			<dt><em>key</em></dt>
			<dd><p>a key such as @&ldquo;name&rdquo;</p></dd>
		</dl>
		
	</div>
	
	
	
	<div class="method-subsection return">
		<h4 class="method-subtitle parameter-title">Return Value</h4>
		<p>The value found in the <a href="#//api/name/context">context</a> stack for the given key.</p>
	</div>
	
	
	
	<div class="method-subsection availability">
		<h4 class="method-subtitle parameter-title">Availability</h4>
		<p>v6.6</p>
	</div>
	
	
	
	<div class="method-subsection discussion-section">
		<h4 class="method-subtitle">Discussion</h4>
		<p>If you want the value for an full expression such as <code>user.name</code> or
<code>uppercase(user.name)</code>, use the <a href="#//api/name/hasValue:forMustacheExpression:error:">hasValue:forMustacheExpression:error:</a>
method.</p>

<h3>Search Pattern for valueForMustacheKey</h3>

<p>The Mustache value of any object for a given key is defined as:</p>

<ol>
<li><p>If the object responds to the <code>objectForKeyedSubscript:</code> instance method,
return the result of this method.</p></li>
<li><p>Otherwise, build the list of safe keys:</p></li>
<li>If the object responds to the <code>safeMustacheKeys</code> class method defined
by the <a href="../Protocols/GRMustacheSafeKeyAccess.html"><code>GRMustacheSafeKeyAccess</code></a> protocol, use this method.</li>
<li>Otherwise, use the list of Objective-C properties declared with
<code>@property</code>.</li>
<li><p>If object is an instance of NSManagedObject, add all the attributes of
its Core Data entity.</p></li>
<li><p>If the key belongs to the list of safe keys, return the result of the
<code>valueForKey:</code> method, unless this method throws NSUndefinedKeyException.</p></li>
<li><p>Otherwise, return nil.</p></li>
</ol>


<p>Contexts with unsafe key access skip the key validation step.</p>

<p>In this method, the following search pattern is used:</p>

<ol>
<li><p>Searches the priority <a href="#//api/name/context">context</a> stack for an object that has a non-nil
Mustache value for the key.</p></li>
<li><p>Otherwise (irrelevant priority <a href="#//api/name/context">context</a> stack), search the <a href="#//api/name/context">context</a> stack
for an object that has a non-nil Mustache value for the key.</p></li>
<li><p>If none of the above situations occurs, returns nil.</p></li>
</ol>


<p><strong>Companion guides:</strong> <a href="https://github.com/groue/GRMustache/blob/master/Guides/runtime.md,">https://github.com/groue/GRMustache/blob/master/Guides/runtime.md,</a>
<a href="https://github.com/groue/GRMustache/blob/master/Guides/view_model.md">https://github.com/groue/GRMustache/blob/master/Guides/view_model.md</a></p>
	</div>
	
	
	
	
	
	<div class="method-subsection see-also-section">
		<h4 class="method-subtitle">See Also</h4>
		<ul>
			
			<li><code><p><a href="#//api/name/contextWithUnsafeKeyAccess">- contextWithUnsafeKeyAccess</a></p></code></li>
			
			<li><code><p><a href="#//api/name/hasValue:forMustacheExpression:error:">- hasValue:forMustacheExpression:error:</a></p></code></li>
			
		</ul>
	</div>
	
	
	
	<div class="method-subsection declared-in-section">
		<h4 class="method-subtitle">Declared In</h4>
		<code class="declared-in-ref">GRMustacheContext.h</code><br />
	</div>				
	
	
</div>
						
					</div>
					
					
                    
                    
				</div>
				<div class="main-navigation navigation-bottom">
					<ul>
	<li><a href="../index.html">Index</a></li>
	<li><a href="../hierarchy.html">Hierarchy</a></li>
</ul>
				</div>
				<div id="footer">
					<hr />
					<div class="footer-copyright">
						<p><span class="copyright">&copy; 2014 Gwendal Roué. All rights reserved. (Last updated: 2014-09-13)</span><br />
						
						<span class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2 (build 961)</a>.</span></p>
						
					</div>
				</div>
			</div>
		</article>
		<script type="text/javascript">
			function jumpToChange()
			{
				window.location.hash = this.options[this.selectedIndex].value;
			}
			
			function toggleTOC()
			{
				var contents = document.getElementById('contents');
				var tocContainer = document.getElementById('tocContainer');
				
				if (this.getAttribute('class') == 'open')
				{
					this.setAttribute('class', '');
					contents.setAttribute('class', '');
					tocContainer.setAttribute('class', '');
					
					window.name = "hideTOC";
				}
				else
				{
					this.setAttribute('class', 'open');
					contents.setAttribute('class', 'isShowingTOC');
					tocContainer.setAttribute('class', 'isShowingTOC');
					
					window.name = "";
				}
				return false;
			}
			
			function toggleTOCEntryChildren(e)
			{
				e.stopPropagation();
				var currentClass = this.getAttribute('class');
				if (currentClass == 'children') {
					this.setAttribute('class', 'children open');
				}
				else if (currentClass == 'children open') {
					this.setAttribute('class', 'children');
				}
				return false;
			}
			
			function tocEntryClick(e)
			{
				e.stopPropagation();
				return true;
			}
			
			function init()
			{
				var selectElement = document.getElementById('jumpTo');
				selectElement.addEventListener('change', jumpToChange, false);
				
				var tocButton = document.getElementById('table_of_contents');
				tocButton.addEventListener('click', toggleTOC, false);
				
				var taskTreeItem = document.getElementById('task_treeitem');
				if (taskTreeItem.getElementsByTagName('li').length > 0)
				{
					taskTreeItem.setAttribute('class', 'children');
					taskTreeItem.firstChild.setAttribute('class', 'disclosure');
				}
				
				var tocList = document.getElementById('toc');
				
				var tocEntries = tocList.getElementsByTagName('li');
				for (var i = 0; i < tocEntries.length; i++) {
					tocEntries[i].addEventListener('click', toggleTOCEntryChildren, false);
				}
				
				var tocLinks = tocList.getElementsByTagName('a');
				for (var i = 0; i < tocLinks.length; i++) {
					tocLinks[i].addEventListener('click', tocEntryClick, false);
				}
				
				if (window.name == "hideTOC") {
					toggleTOC.call(tocButton);
				}
			}
			
			window.onload = init;
			
			// If showing in Xcode, hide the TOC and Header
			if (navigator.userAgent.match(/xcode/i)) {
				document.getElementById("contents").className = "hideInXcode"
				document.getElementById("tocContainer").className = "hideInXcode"
				document.getElementById("top_header").className = "hideInXcode"
			}
			
		</script>
	</body>
</html>